package com.project.mapper;

import com.project.bean.EmployeeBean;
import com.project.bean.ProcessBean;
import com.project.bean.ProjectBean;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface IProcessMapper {

    /**
     * 员工完成项目，将指定进度id对应的记录，完成时间修改为当前时间
     * @param processId 进度id
     */
    @Update("update t_em_pro set pro_endTime = CURDATE() where fk_emId = #{id}")
    public void finishProject(@Param("id") int processId);

    /**
     * 添加员工参与项目的进度信息
     * @param process 进度对象
     */
    @Insert("INSERT INTO t_em_pro(fk_emId,fk_proId,pro_startTime,pro_endTime) VALUES (#{employee.id},#{project.id},#{startDate},#{endDate})")
    public void addEmployee(ProcessBean process);

}
